<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
    <jsp:include page="../header.jsp"></jsp:include>
	<div class="container" style="background: #FFF;">
	<div class="page-header">
	<h1>JFinal Model详解<a href="/model/paginate?pageNumber=1"><span style="font-size:12px;color:#CCC;">进入分页版</span></a></h1>
	</div>
	<div class="row" style="margin-bottom: 20px;">
	<div class="col-lg-6 col-md-6">
	<form action="/model/search" method="post">
		<input type="text" name="keywords" value="${keywords }" class="form-control" style="width:300px;" placeholder="输入关键词搜索">
	</form>
	</div>
	<div class="col-lg-6 col-md-6" style="text-align: right;">
		<a class="btn btn-primary" href="/model/form">新增</a>
		<a class="btn btn-primary" href="/model/randomSave">随机新增</a>
	</div>
	</div>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th>序号</th>
					<th>标题</th>
					<th>发布时间</th>
					<th>操作</th>
				</tr>
			</thead>
			<c:forEach items="${blogs }" var="b" varStatus="s">
				<tr>
					<td>${s.index+1 }</td>
					<td>${b.title }</td>
					<td>${b.publishTime }</td>
					<td><a class="btn btn-primary btn-sm" href="/model/form?id=${b.id }">编辑</a> <a class="btn btn-danger btn-sm"
						href="/model/delete?id=${b.id }">删除</a></td>
				</tr>
			</c:forEach>
		</table>
		</div>
	<jsp:include page="../footer.jsp"></jsp:include>
